<?php
$_doc = array();
$_doc['title'] = L('tab_user_edit');
L(include(LANG_PATH.LANG_SET.'/pRole.php'));
?>
<include file="pAdmin:header" />
<table class="tabmenu" cellspacing="0">
    <tbody>
        <tr>
            <td class="wedge">&nbsp;</td>
            <td class="wmenu"><a href="__URL__/index"><span>{%tab_user_list}</span></a></td>
            <td class="wmenu"><a href="__URL__/add"><span>{%tab_user_add}</span></a></td>
            <td class="wmenu here">{%tab_user_edit}</td>
            <td class="wmenu"><a href="__APP__/pRole/index"><span>{%tab_role_list}</span></a></td>
            <td class="wmenu"><a href="__APP__/pRole/add"><span>{%tab_role_add}</span></a></td>
            <td>&nbsp;</td>
        </tr>
    </tbody>
</table>
<div class="main">
    <p class="editpage user">
    <?php echo sprintf(L('page_title_user_edit'),$rs['account']);?>
    </p>
    <ul class="fnc">
        <li><button type="button" class="btn primary" onclick="act('update')">{%action_update}</button></li>
        <li><button type="button" class="btn" onclick="act('back')">{%action_back}</button></li>
    </ul>
    <form id="ipsForm" class="validateform" name="mainForm" method="post" action="__URL__">
        <input type="hidden" name="a">
        <input type="hidden" name="id" value="{$rs['id']}">
        <table class="ips">
            <tbody>
                <tr>
                    <th class="essential"><label for="pk1">{%column_role_belong}</label></th>
                    <td>
                        <select class="validate[selectRequired]" name="role" id="pk1">
                            <option value="">{%page_pls_select}</option>
                            <iterate name="roles" id="vo">
                            <option value="{$vo['id']}">{$vo['name']}</otpion>
                            </iterate>
                        </select>
                        <script type="text/javascript">
                            setSelectOption("pk1","{$rs['role']}");
                        </script>
                    </td>
                </tr>
                <tr>
                    <th><label for="pk3">{%column_password}</label></th>
                    <td>
                        <input class="validate[password]" type="password" id="pk3" name="password" size="32" maxlength="16" />
                        <p class="hint">{%column_password_tip}<b>{%column_password_edit_tip}</b></p>
                    </td>
                </tr>
                <tr>
                    <th class="essential"><label for="pk4">{%column_realname}</label></th>
                    <td>
                        <input type="text" id="pk4" class="validate[required]" name="realname" size="40" maxlength="32" value="{$rs['realname']}"/>
                        <p class="hint">{%column_realname_tip}</p>
                    </td>
                </tr>
                <tr>
                    <th><label for="pk5">{%column_mail}</label></th>
                    <td>
                        <input class="validate[email]" type="text" id="pk5" name="email" size="60" maxlength="64" value="{$rs['email']}"/>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
    <ul class="fnc">
        <li><button type="button" class="btn primary" onclick="act('update')">{%action_update}</button></li>
        <li><button type="button" class="btn" onclick="act('back')">{%action_back}</button></li>
    </ul>
</div>
<include file="pAdmin:footer" />
